﻿<?xml version="1.0" encoding="utf-8"?>
<xsd:schema id="WebflowSchema" targetNamespace="http://schemas.microsoft.com/dsltools/Webflow" elementFormDefault="qualified" xmlns="http://schemas.microsoft.com/dsltools/Webflow" xmlns:core="http://schemas.microsoft.com/VisualStudio/2008/DslTools/Core" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <xsd:import id="CoreSchema" namespace="http://schemas.microsoft.com/VisualStudio/2008/DslTools/Core" />
  <!-- WebflowModel -->
  <xsd:element name="webflowModel" type="WebflowModel" substitutionGroup="core:modelElement" />
  <xsd:complexType name="WebflowModel">
    <xsd:annotation>
      <xsd:documentation>The root in which all other elements are embedded. Appears as a diagram.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="core:ModelElement">
        <xsd:sequence minOccurs="0" maxOccurs="1">
          <!-- Relationship: WebflowModelHasElements -->
          <xsd:choice minOccurs="0" maxOccurs="unbounded" >
            <xsd:element ref="webflowModelHasElements">
              <xsd:annotation>
                <xsd:documentation>[Relationship deriving from WebflowModelHasElements needs to be serialized in full-form]</xsd:documentation>
              </xsd:annotation>
            </xsd:element>
            <xsd:element ref="state" >
              <xsd:annotation>
                <xsd:documentation>[Target role-player]</xsd:documentation>
              </xsd:annotation>
            </xsd:element>
          </xsd:choice>
          <!-- Relationship: WebflowModelReferencesFirstState -->
          <xsd:element name="firstState" minOccurs="1" maxOccurs="1">
            <xsd:annotation>
              <xsd:documentation>Instance of WebflowModelReferencesFirstState</xsd:documentation>
            </xsd:annotation>
            <xsd:complexType>
              <xsd:sequence>
                <xsd:choice minOccurs="1" maxOccurs="1" >
                  <xsd:element ref="webflowModelReferencesFirstState">
                    <xsd:annotation>
                      <xsd:documentation>[Relationship deriving from WebflowModelReferencesFirstState needs to be serialized in full-form]</xsd:documentation>
                    </xsd:annotation>
                  </xsd:element>
                  <xsd:element ref="stateMoniker" >
                    <xsd:annotation>
                      <xsd:documentation>[Target role-player]</xsd:documentation>
                    </xsd:annotation>
                  </xsd:element>
                </xsd:choice>
              </xsd:sequence>
            </xsd:complexType>
          </xsd:element>
        </xsd:sequence>
        <!-- dslVersion -->
        <xsd:attribute name="dslVersion" type="xsd:string">
          <xsd:annotation>
            <xsd:documentation>Version of the model serialized in this file.</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
        <!-- Property: Name -->
        <xsd:attribute name="name" type="xsd:string" use="required" />
        <!-- Property: Model -->
        <xsd:attribute name="model" type="xsd:string" />
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- WebflowModel Moniker -->
  <xsd:element name="webflowModelMoniker" type="WebflowModelMoniker" substitutionGroup="core:modelElementMoniker" />
  <xsd:complexType name="WebflowModelMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for WebflowModel instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="core:ModelElementMoniker">
        <xsd:attribute name="name" type="xsd:string" >
          <xsd:annotation>
            <xsd:documentation>Attribute to store the moniker string.</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- State -->
  <xsd:element name="state" type="State" substitutionGroup="core:modelElement" />
  <xsd:complexType name="State">
    <xsd:annotation>
      <xsd:documentation>Elements embedded in the model. Appear as boxes on the diagram.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="core:ModelElement">
        <xsd:sequence minOccurs="0" maxOccurs="1">
          <!-- Relationship: Transition -->
          <xsd:element ref="transition" minOccurs="0" maxOccurs="unbounded">
            <xsd:annotation>
              <xsd:documentation>[Instance of Transition needs to be serialized in full-form]</xsd:documentation>
            </xsd:annotation>
          </xsd:element>
        </xsd:sequence>
        <!-- Property: Name -->
        <xsd:attribute name="name" type="xsd:string" use="required" />
        <!-- Property: IsEndState -->
        <xsd:attribute name="isEndState" type="xsd:boolean" />
        <!-- Property: RouteData -->
        <xsd:attribute name="routeData" type="xsd:string" />
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- State Moniker -->
  <xsd:element name="stateMoniker" type="StateMoniker" substitutionGroup="core:modelElementMoniker" />
  <xsd:complexType name="StateMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for State instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="core:ModelElementMoniker">
        <xsd:attribute name="name" type="xsd:string" >
          <xsd:annotation>
            <xsd:documentation>Attribute to store the moniker string.</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- ViewState -->
  <xsd:element name="viewState" type="ViewState" substitutionGroup="state" />
  <xsd:complexType name="ViewState">
    <xsd:complexContent>
      <xsd:extension base="State">
        <!-- Property: ViewPath -->
        <xsd:attribute name="viewPath" type="xsd:string" />
        <!-- Property: IncludeFields -->
        <xsd:attribute name="includeFields" type="xsd:string" />
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- ViewState Moniker -->
  <xsd:element name="viewStateMoniker" type="ViewStateMoniker" substitutionGroup="stateMoniker" />
  <xsd:complexType name="ViewStateMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for ViewState instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="StateMoniker">
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- SubflowState -->
  <xsd:element name="subflowState" type="SubflowState" substitutionGroup="state" />
  <xsd:complexType name="SubflowState">
    <xsd:complexContent>
      <xsd:extension base="State">
        <!-- Property: FlowName -->
        <xsd:attribute name="flowName" type="xsd:string" />
        <!-- Property: ModelField -->
        <xsd:attribute name="modelField" type="xsd:string" />
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- SubflowState Moniker -->
  <xsd:element name="subflowStateMoniker" type="SubflowStateMoniker" substitutionGroup="stateMoniker" />
  <xsd:complexType name="SubflowStateMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for SubflowState instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="StateMoniker">
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- WebflowModelHasElements -->
  <xsd:element name="webflowModelHasElements" abstract="true" type="WebflowModelHasElements" substitutionGroup="core:modelElement" />
  <xsd:complexType name="WebflowModelHasElements" abstract="true" >
    <xsd:annotation>
      <xsd:documentation>Embedding relationship between the Model and Elements</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="core:ModelElement">
        <xsd:sequence minOccurs="0" maxOccurs="1">
          <!-- Target end State -->
          <xsd:element ref="state" minOccurs="1" maxOccurs="1">
            <xsd:annotation>
              <xsd:documentation>[Target role-player]</xsd:documentation>
            </xsd:annotation>
          </xsd:element>
        </xsd:sequence>
        <!-- Id -->
        <xsd:attribute name="Id" type="xsd:string">
          <xsd:annotation>
            <xsd:documentation>Instance Guid of this element, needed because SerializeId is set to true.</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- WebflowModelHasElements Moniker -->
  <xsd:element name="webflowModelHasElementsMoniker" type="WebflowModelHasElementsMoniker" substitutionGroup="core:modelElementMoniker" />
  <xsd:complexType name="WebflowModelHasElementsMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for WebflowModelHasElements instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="core:ModelElementMoniker">
        <xsd:attribute name="Id" type="xsd:string" >
          <xsd:annotation>
            <xsd:documentation>Attribute to store the moniker string.</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- Transition -->
  <xsd:element name="transition" type="Transition" substitutionGroup="core:modelElement" />
  <xsd:complexType name="Transition">
    <xsd:annotation>
      <xsd:documentation>Reference relationship between Elements.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="core:ModelElement">
        <xsd:sequence minOccurs="0" maxOccurs="1">
          <!-- Target end State -->
          <xsd:element ref="stateMoniker" minOccurs="1" maxOccurs="1">
            <xsd:annotation>
              <xsd:documentation>[Target role-player]</xsd:documentation>
            </xsd:annotation>
          </xsd:element>
        </xsd:sequence>
        <!-- Property: On -->
        <xsd:attribute name="on" type="xsd:string" />
        <!-- Property: RequireValidModel -->
        <xsd:attribute name="requireValidModel" type="xsd:boolean" />
        <!-- Property: Condition -->
        <xsd:attribute name="condition" type="xsd:string" />
        <!-- Property: IsDefault -->
        <xsd:attribute name="isDefault" type="xsd:boolean" />
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- Transition Moniker -->
  <xsd:element name="transitionMoniker" abstract="true" type="TransitionMoniker" substitutionGroup="core:modelElementMoniker" />
  <xsd:complexType name="TransitionMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for Transition instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="core:ModelElementMoniker">
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- WebflowModelReferencesFirstState -->
  <xsd:element name="webflowModelReferencesFirstState" abstract="true" type="WebflowModelReferencesFirstState" substitutionGroup="core:modelElement" />
  <xsd:complexType name="WebflowModelReferencesFirstState" abstract="true" >
    <xsd:complexContent>
      <xsd:extension base="core:ModelElement">
        <xsd:sequence minOccurs="0" maxOccurs="1">
          <!-- Target end State -->
          <xsd:element ref="stateMoniker" minOccurs="1" maxOccurs="1">
            <xsd:annotation>
              <xsd:documentation>[Target role-player]</xsd:documentation>
            </xsd:annotation>
          </xsd:element>
        </xsd:sequence>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- WebflowModelReferencesFirstState Moniker -->
  <xsd:element name="webflowModelReferencesFirstStateMoniker" abstract="true" type="WebflowModelReferencesFirstStateMoniker" substitutionGroup="core:modelElementMoniker" />
  <xsd:complexType name="WebflowModelReferencesFirstStateMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for WebflowModelReferencesFirstState instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="core:ModelElementMoniker">
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
</xsd:schema>

